package com.demo.springboothexadecimalconversion.constant;

/**
 * @author Hanson
 * @date 2022/11/15 15:26
 */
public enum MsgFrame {
    Health("1"),

    TurnOver("2"),

    OnBedStatus("3"),

    SleepApnea("4"),

    Fall("5"),

    OTAUpgrade("112"),

    OTAStatus("113"),

    OTAConfig("114"),

    DeviceInfo("128");
    private String value;

    MsgFrame(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static MsgFrame getByValue(String code) {
        for (MsgFrame mf : values()) {
            if (code.equals(mf.getValue())) {
                return mf;
            }
        }
        return null;
    }
}
